//    Copyright (C) Kherty.  All rights reserved.
using System;

namespace OpenLS.Spreadsheet
{
    /// <summary>
    /// Interaction logic for SplashWindow.xaml
    /// </summary>
    public partial class SpreadsheetSplashWindow
    {
        public SpreadsheetSplashWindow()
        {
            InitializeComponent();
        }

        private void OnLoaded(object sender, object args)
        {
            try
            {
                string s = GetType().Assembly.FullName;
                string[] ss = s.Split(',');
                string version = ss[1];
                string[] versions = version.Split('.');
                int monthDay = int.Parse(versions[3]);
                int month = monthDay/100;
                int day = monthDay - month*100;
                var versionDate = new DateTime(int.Parse(versions[2]), month, day);
                string displayDate = string.Format("{0}/{1}/{2}", versionDate.Year, versionDate.Month, versionDate.Day);
                versionTextBlock.Text = string.Format("{0}.{1} [{2}]", versions[0], versions[1], displayDate);
            }
            catch
            {
            }
        }
    }
}